This page last changed on Dec 18, 2007 by aaime.

There are 4 ways to send SLD to Geoserver:

  1. (http get) SLD=(URL) geoserver makes an http location to the SLD and loads it. This allows you to specify the location of your SLD document without the need of having to send it as part of your request. Note you should pass a complete URL for the document and it has to be accessible for the server.
  2. (http get) SLD_BODY=... send an SLD file to geoserver using GET. When doing so directly through a web browser, be aware that Internet Explorer will cut your CGI querystring (I guess to 1024 characters), so your inline SLD document can be truncated thus not being parsed by the WMS. If you run in such a case, consider using a Gecko based browser like Mozilla or using HTTP POST method to send the complete SLD document.
  3. (http post) WMS GetMap 1.2 Send the SLD (and other request parameters) in a POST XML document. This is how the SLD spec says you should do it.
  4. (http post) GET Parameters, SLD in the Post Use http GET for the parameters (ie. location and image size) and use POST for the SLD

When you specify the layers to be drawn through the LAYERS=... parameter, the GetMap request is meant to be in "library" mode. Library mode stands that the SLD document you provide acts as a libraty of styles from where to obtain the styling rules for the requested layers, taking precedence over the styles residing on the server. This way you can compose your GetMap request as usual and provide custom styling for some layers, relying on their defaults or other server side styles as usual for the rest.

The other way of composing your map through custom SLD is known as "Literal mode". In this way, you do not provide a LAYERS= parameter, but specifies exactly which layers has to be drawn from the <NamedLayer> and <UserLayer> elements inside your StyledLayerDescriptor document.

Finally, note that GeoServer will validate the SLD documents you provide agains the SLD 1.0 xml schema, both through the web admin interface as for user defined symbolization through one of the methods mentioned above.

For more information on the internals of GetMap request composition consult the SLD 1.0 spec.

Document generated by Confluence on Jan 16, 2008 23:27